/*
 * debug.cpp
 *
 *  Created on: Jun 8, 2011
 *      Author: timothy
 */

#include "debug.h"
#include <omp.h>


void pdprint(int debugLevel, const char *format, ...)
{
	if((debugLevel & DEBUG_LEVEL) == 0) return;
	else
	{
	va_list args;
	va_start(args, format);
	#pragma omp critical (PDPRINT)
	{
		fprintf(stderr, "DEBUG T%d: ", omp_get_thread_num());
		vfprintf(stderr, format, args);
	}
	va_end(args);
	}
}
